package es.decloud.webapp.util;

import org.apache.commons.lang3.StringUtils;

public class PasswordEncoderUtil {

	public static String encode(String txt) {
		org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder encoder = new org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder();
		
		return (StringUtils.isNotBlank(txt)) ? encoder.encode(txt) : StringUtils.EMPTY;
	}

	public static void main(String[] args) {
		System.out.println("admin: " + PasswordEncoderUtil.encode("admin"));
		System.out.println("user: " + PasswordEncoderUtil.encode("user"));
		System.out.println("gerente: " + PasswordEncoderUtil.encode("gerente"));
		System.out.println("administrativo: " + PasswordEncoderUtil.encode("administrativo"));
		System.out.println("educadora: " + PasswordEncoderUtil.encode("educadora"));
		System.out.println("tutor: " + PasswordEncoderUtil.encode("tutor"));
	}
}
